<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品管理</title>
    <link rel="stylesheet"  type="text/css" href="/css/reset.css">
    <link rel="stylesheet"  type="text/css" href="/css/main.css">
    <script type="text/javascript" src="/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="/js/user_index_commodity.js"></script>
</head>
<body class="base_background">
    <div class="base">
        <div class="base_info">
            <h3>商品管理</h3>
        </div>
        <div class="base_content">
            <table>
                {{if commodityResult}}
                <tr>
                    <th width="40px">编号</th>
                    <th width="300px">产品名称</th>
                    <th width="60px">上架时间</th>
                    <th width="60px">分类</th>
                    <th width="60px">单价</th>
                    <th width="60px">销售量</th>
                    <th width="90px">操作</th>
                </tr>
                {{each commodityResult}}
                <tr>
                    <td name="commodity_id">{{$value.commodity_id}}</td>
                    <td>{{$value.commodity_name}}</td>
                    <td>{{$value.upload_time | dateFormat}}</td>
                    <td>{{$value.commenter.classify_name}}</td>
                    <td>￥{{$value.unit_price}}</td>
                    <td>{{$value.sales_volume}}</td>
                    <td>
                        <a href="/user_index_commodity_management/modify/{{$value.commodity_id}}"><button>修改</button></a>
                        <a href=""><button class="del_commodity" commodity_id="{{$value.commodity_id}}" merchant_id="{{$value.merchant_id}}">下架</button></a>
                    </td>
                </tr>
                {{/each}}
                {{else}}
                <tr>
                    <th>您还似乎还没有发布商品呢！</th>
                </tr>
                {{/if}}
            </table>
        </div>
    </div>
</body>
</html>